package com.tedu.food.common.schedule;

import java.util.concurrent.atomic.AtomicInteger;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import com.tedu.food.sys.service.impl.OrderMasterServiceImpl;

/**
 * 定时任务
 * @author 杨老师
 *
 */
@Component
public class ScheduleTask {
	
	@Autowired
	private OrderMasterServiceImpl orderMaster;
	
	/**
	 * 每天零点刷新取餐号为1
	 */
	@Scheduled(cron = "0 0 0 * * ?")
	public void refreshOrderGetNo() {
		AtomicInteger at = orderMaster.getAt();
		at.set(1);
	}
}
